//#condition MicroFunnel||MicroFunnelAbility
//# package MicroLogos;
//#
//# /*
//#  * MicroFunnel.java
//#  *
//#  * Created on 26. listopad 2006, 9:28
//#  */
//# package MicroLogos;
//#
//#
//#
//# import javax.microedition.midlet.*;
//#
//# import javax.microedition.lcdui.*;
//#
//# import javax.microedition.io.*;
//# //import javax.microedition.rms.*;
//# import java.util.*;
//#
//# import java.io.*;
//# ///*#C65,SL45#*///<editor-fold>
//# import com.siemens.mp.io.*;
//# ///*$C65,SL45$*///</editor-fold>
//#
//# /**
//#  *
//#  * @author  marek
//#  * @version
//#  */
//# public class MicroFunnel extends mVocabSL45 implements Runnable {
//# //tyto vse prebiram z mVocabSL45
//# //    com.siemens.mp.io.File rms;
//# //    public CView View;
//# //    Display display;    // The display for this MIDlet
//# //  Thread thread;
//#
//#   public boolean inited = false;
//#   Translation menuTrans;
//#   Translation catSelect;
//#
//#   public MicroFunnel() {
//#if SiemensFile&&!RmsFile
//#     rms=new com.siemens.mp.io.File();
//#else
//#     rms = new RmsFile();
//#endif
//#     fHeapName = getAppProperty("fHeap");
//#     fListName = getAppProperty("fList");
//#     display = Display.getDisplay(this);
//#   }
//#
//#   public void startApp() {
//#     View = new CView(this);//,this.get(this.LOADING));
//#     View.setProgress();
//#     display.setCurrent(View);
//#     debug("po setCurent");
//#     View.setWords(get(this.LOADING, null));
//#     View.setProgress();
//#     debug("po setWords");
//#     inited = false;
//#     Vector trs = new Vector();
//#     Vector exts = new Vector();
//#     trs.addElement("Konec");
//#     exts.addElement(Task.Menu(Task.MENU_EXIT, 0));
//#     menuTrans = new Translation(Translation.MENU, "Menu", trs, exts, 0);
//#     thread = new Thread(this);
//#     thread.setPriority(Thread.NORM_PRIORITY);
//#     thread.start();
//#     debug("po threadStart");
//#   }
//#
//#   public void pauseApp() {
//#   }
//#
//#   public void destroyApp(boolean unconditional) {
//# //    try{
//#     closeBuf(rms);
//# //    }catch(IOException e){}
//# //      super.destroyApp();
//#     this.notifyDestroyed();
//#   }
//#
//#   void init() {
//#     Translation trans = readVocab();
//#     if (trans != null) {
//#       menuTrans = trans;
//#       debug("id nahratyho jazyka:" + menuTrans.poz);
//#       if (menuTrans.poz >= 0) {
//#         int newVocab = (int) menuTrans.poz;
//#         menuTrans.setChoice(-1);
//#         this.process(Task.Menu(Task.MENU_VOCAB, newVocab));
//#
//#       } else {
//#         View.setWords(get(CHOOSE_LANGUAGE, null));
//#       }
//#     } else {
//#       View.setWords(get(this.ERROR_LOAD, null));
//#     }
//#     inited = true;
//#   }
//#
//#   Translation readVocab() {
//#     Vector trs = new Vector();
//#     Vector exts = new Vector();
//#     Translation trans = new Translation(Translation.MENU, "Menu", trs, exts, -1);
//#     trs.addElement("Konec");
//#     exts.addElement(Task.Menu(Task.MENU_EXIT, 0));
//#     trs.addElement("Vyber kategorie...");
//#     exts.addElement(Task.Menu(Task.MENU_LEARN, 0));
//#     try {
//#       if (bufLang == null) {
//#         readBuf(rms);
//#       }
//#       int b;
//#       int activeLang = -1;
//# //      int alternativeB=NUM_LANG;
//#       for (b = 0; b < NUM_LANG; b++) {
//#         if ((bufLang[b * LEN_LANG] & FLAG_USED) > 0) {
//#           trs.addElement(readHeap(bufLang, b * LEN_LANG + 3));
//# //int langId=bufLang[b*LEN_LANG+1]|(bufLang[b*LEN_LANG+2]<<8);
//#           int langId = b;
//#           exts.addElement(Task.Menu(Task.MENU_VOCAB, langId));
//#           if (bufLang[b * LEN_LANG + 13] == 1) {
//#             activeLang = langId;
//#           }
//#         }
//#         if (bufLang[b * LEN_LANG] == 0) {
//#           break;
//#         }
//# //        if ((bufLang[b*LEN_LANG]&FLAG_DEL)>0) alternativeB=b;
//#       }
//# //      trs.addElement("Kategorie...");
//# //      exts.addElement(Task.Menu(Task.MENU_LEARN,0));
//#       trans.setChoice(activeLang);
//#     } catch (IOException e) {
//#       debug("IO v readVocab " + e.toString());
//#       e.printStackTrace();
//#       return null;
//#     }
//#     return trans;
//#   }
//#
//#   byte getLang(boolean small) {
//#     byte id1 = getLang(1);
//#     byte id2 = getLang(2);
//#     if (small == id1 < id2) {
//#       return id1;
//#     } else {
//#       return id2;
//#     }
//#   }
//#
//#   byte getSmallLang() {
//#     return getLang(true);
//#   }
//#
//#   byte getBigLang() {
//#     return getLang(false);
//#   }
//#
//#   String getName() {
//#     String str = (String) (menuTrans.trs.elementAt(menuTrans.prefix));
//#     if (str.charAt(0) == '*') {
//#       return str.substring(1);
//#     } else {
//#       return str;
//#     }
//#   }
//#
//#   byte getLang(int i) {
//#     int ind;
//#     if ((ind = this.menuTrans.poz) < 0) {
//#       debug("asi by se nemelo ptat na aktualni jazyk, kterej jeste neni vybranej");
//#       return -1;
//#     }
//#     byte id = bufLang[LEN_LANG * ind + i];
//#     return id;
//#   }
//#
//#   byte getFromLang() {
//#     return getLang(1);
//#   }
//#
//#   byte getToLang() {
//#     return getLang(2);
//#   }
//#
//#   Translation catSelect2catInfo() {
//#     Vector trs = new Vector();
//#     Vector exts = new Vector();
//#     trs.addElement("Jazyk: " + getName() + "\n");
//#     exts.addElement(null);
//#     trs.addElement("Kategorie:\n");
//#     exts.addElement(null);
//#     for (int i = 0; i < catSelect.trs.size(); i++) {
//#       if (catSelect.extstrs.elementAt(i) != null) {
//#         if (((Task) catSelect.extstrs.elementAt(i)).relpoz > 0) {
//#           trs.addElement(catSelect.trs.elementAt(i) + "\n");
//#           exts.addElement(null);
//#         }
//#       }
//#     }
//#     return new Translation(Translation.INFO, "V�b�r k u�en�", trs, exts, 0);
//#   }
//#
//#   public void process(Task t) {
//#     View.setProgress();
//#     int poz = (int) t.poz;
//#     int relpoz = (int) t.relpoz;
//#     if (t.type == Translation.MENU) {
//#       processMenu(poz, relpoz);
//#     }
//#     View.unsetProgress();
//#   }
//#
//#   void processMenu(int poz, int relpoz) {
//#     if (poz == 0) {
//#       if (View.Words.type == Translation.SELECT) {
//#         debug("Assert: processMenu: pozadavek na menu ze SELECTu");
//#       }
//#       View.setWords(menuTrans);
//#       return;
//#     }
//#     if (poz == Task.MENU_EXIT) {
//#       this.destroyApp(true);
//#     }
//#     if (poz == Task.MENU_VOCAB) {
//#       int oldVocab = (int) menuTrans.poz;
//#       menuTrans.setChoice(relpoz);
//# //debug("pred readLearnGen "+getSmallLang()+" "+getBigLang());
//#       Translation newSelect = readLearnGen(rms, getSmallLang(), getBigLang(), "V�b�r kategor��");
//#       if (newSelect == null) {
//#         debug("newSelect je null|");
//#         View.setWords(get(ERROR_LOAD_CATH, getName()));
//#         menuTrans.setChoice(oldVocab);
//#         return;
//#       }
//# //debug("newSelect je v poho");
//#       newSelect.trs.insertElementAt(getName() + " slovn�k", 0);
//#       newSelect.extstrs.insertElementAt(null, 0);
//# //debug("newSelect po uprave");
//#       if (oldVocab > -1) {
//#         bufLang[LEN_LANG * oldVocab + 13] = 0;
//#       }
//#       if (relpoz > -1) {
//#         bufLang[LEN_LANG * relpoz + 13] = 1;
//#       } else {
//#         debug("nemelo by se stat, ze preminam na jazyk -1");
//#       }
//#       catSelect = newSelect;
//#       //trochu zbytecne ted znovuzapiseme stav na disk, ale udelame pri tom
//#       //vytvoreni dost velkych word*Listu, catInfo, catTest
//# //debug("predWriteSelect");
//#       writeCatSelect();
//#     }
//#     if (poz == Task.MENU_LEARN) {
//#       if (menuTrans.poz < 0) {
//#         View.setWords(get(CHOOSE_LANGUAGE, null));
//#         return;
//#       }
//#       if (catSelect == null) {
//# //debug("Nemelo by se stat: catSelect je null ale presto je vybranej jazyk");
//#         return;
//#       }
//#       View.setWords(catSelect);
//#       return;
//#     }
//#     if (poz == Translation.SELECT) {
//#       writeCatSelect();//zapise novou aktivitu kategorii do flashky
//#       //zaroven prepise catInfo, zobrazi ho a vytvori catTest
//#       return;
//#     }
//#     if (poz == Task.MENU_SELECT_BACK) {
//#       //neni uplne nejefektivnejsi zpusob jak obnovit puvodni hodnoty v catSelect
//#       process(Task.Menu(Task.MENU_VOCAB, menuTrans.poz));
//#       return;
//#     }
//#   }
//#
//#   private void writeCatSelect() {
//#     Vector v = catSelect.extstrs;
//#     int newLen = 0;
//#     for (int i = 0; i < v.size(); i++) {
//#       if (v.elementAt(i) != null) {
//#         Task t = (Task) v.elementAt(i);
//#         if (t.type == Translation.SELECT) {
//#           //debug("saham do bufCath");
//#           if (t.poz < 256) {
//#             bufCath[LEN_CATH * t.poz + 8] =//nastavim aktivitu prvniho smeru
//#                     (byte) ((bufCath[LEN_CATH * t.poz + 8] & 2) + t.relpoz);
//#           }
//#           if (t.poz > 255) {
//#             bufCath[LEN_CATH * (t.poz & 0xff) + 8] =//nastavim aktivitu druhyho smeru
//#                     (byte) ((bufCath[LEN_CATH * (t.poz & 0xff) + 8] & 1) + t.relpoz * 2);
//#           }
//#           if (t.relpoz > 0) {
//#             newLen += bufCath[LEN_CATH * (t.poz & 0xff) + CATH_NUMBER] & 0xff;
//#           }
//#         }
//#       }
//#     }
//# //debug("pred new wordListy");
//#     if (wordIndList == null || wordIndList.length < newLen) {
//#       wordIndList = doubleList(wordIndList, newLen);
//#       wordOppList = doubleList(wordOppList, newLen);
//#       wordTryList = doubleList(wordTryList, newLen);
//#       wordSuccList = doubleList(wordSuccList, newLen);
//#     }
//# //debug("po new wordListy");
//#     wordNum = -1;//word*Listy je potreba nejdriv naplnit
//#     View.setWords(catSelect2catInfo());
//#     createCatTest();
//#     return;
//#   }
//#   private static final int LEN_BUF = LEN_THICK * 500;
//#   private byte[] buf;
//#   private int pozbuf;
//#   byte[] catTest, fromTest, toTest;
//#   char[] wordIndList, wordTryList, wordSuccList, wordOppList;
//#   int wordNum = -1;
//#   private String text;
//#   private int minI = -1;
//# //  private int smT,smS;
//#
//#   void createCatTest() {
//#     //nejdriv vynulujem predchozi aktualni slovicko
//#     minI = -1;
//#     text = null;
//#     int len = 0;
//#     Vector e = catSelect.extstrs;
//#     for (int i = 0; i < e.size(); i++) {
//#       if (e.elementAt(i) != null && ((Task) e.elementAt(i)).relpoz == 1) {
//#         len++;
//#       }
//#     }
//# //debug("len v createCatTest: "+len);
//#     catTest = new byte[len];
//#     fromTest = new byte[len];
//#     toTest = new byte[len];
//#     byte from = getFromLang();
//#     byte to = getToLang();
//#     int ind = 0;
//#     Task t;
//#     for (int i = 0; i < e.size(); i++) {
//#       if (e.elementAt(i) != null && (t = (Task) e.elementAt(i)).relpoz == 1) {
//#         catTest[ind] = (byte) (t.poz & 0xff);
//#         fromTest[ind] = t.poz > 255 ? to : from;
//#         toTest[ind] = t.poz > 255 ? from : to;
//# //debug("catTest[ind]: "+catTest[ind]+" fromTest[ind] "+fromTest[ind]+" toTest[ind]: "+toTest[ind]);
//#         ind++;
//#       }
//#     }
//#   }
//#
//#   Translation nextQuestion() {
//# //debug("nextQuestion");
//#     minI = getMin();
//# //debug("minI je "+minI+", minInd je "+wordIndList[minI]);
//#     if (minI == -1) {
//#       return get(NO_WORD, null);
//#     }
//#     if (minI == -2) {
//#       return get(ERROR_READ_WORD, null);
//#     }
//#     return showWord(false);
//#     //return null;
//# //    rms.seek(fList,)
//#   }
//#
//#   Translation showWord(boolean whole) {
//#     try {
//#       int start = LIST_HEADER_LEN + LEN_LANG * NUM_LANG + LEN_CATH * NUM_CATH;
//# //      if (text==null){
//#       int minInd = wordIndList[minI];
//#       if (minInd * LEN_THICK < pozbuf) {
//#         rms.seek(fList, start + (minInd * LEN_THICK) / LEN_BUF * LEN_BUF);
//#         rms.read(fList, buf, 0, LEN_BUF);
//#       }
//#       int poz = (/*start+*/minInd * LEN_THICK) % LEN_BUF;
//#       if (text == null) {
//#         text = readHeap(buf, poz + 5);
//#       }
//# //      }
//#
//#       int headerInd = text.indexOf('\u0000');
//#       if (headerInd == -1) {
//#         debug("nemelobysestat: neni oddelovac v textu slovicka");
//#         headerInd = text.indexOf(' ');
//#         if (headerInd == -1) {
//#           headerInd = text.indexOf(Delimiter);
//#         }
//#         if (headerInd == -1) {
//#           headerInd = text.length() - 1;
//#         }
//#       }
//#       String header = text.substring(0, headerInd);
//#       if (whole) {
//#         return Translation.fromArray(Translation.INFO, header,
//#                 new String[]{text.substring(headerInd + 1), "\n", "2->Um�m\n", "3->Neum�m\n"});
//#       } else {
//#         int grammarInd = text.indexOf(']');
//#         if (buf[poz + 4] == 0) {
//#           if (grammarInd == -1) {
//#             return Translation.fromArray(Translation.INFO, header,
//#                     new String[]{"?\n", "1->Uka�"});
//#           } else {
//#             return Translation.fromArray(Translation.INFO, header,
//#                     new String[]{"[?] ?\n", "1->Uka�"});
//#           }
//#         } else {
//#           if (grammarInd == -1) {
//#             return Translation.fromArray(Translation.INFO, "?",
//#                     new String[]{text.substring(headerInd + 1), "\n", "1->Uka�"});
//#           } else {
//#             return Translation.fromArray(Translation.INFO, "?",
//#                     new String[]{"[?] ", text.substring(grammarInd + 1), "\n", "1->Uka�"});
//#           }
//#         }
//#       }
//#
//#     } catch (IOException e) {
//#       debug("IO v showWord");
//#       return get(ERROR_READ_WORD, null);
//#     }
//#   }
//#
//#   int getMin() {
//# //    if (index==null) index= newIndex();
//#     if (wordNum < 0) {
//#       try {
//# //debug("generuju wordListy");
//#         wordNum = 0;
//#         if (catTest == null) {
//#           debug("nemelo by se stat: catTest nepripraven v getMin()");
//#           createCatTest();
//#         }
//#         if (buf == null) {
//#           buf = new byte[LEN_BUF];
//#         }
//#         int start = LIST_HEADER_LEN + LEN_LANG * NUM_LANG + LEN_CATH * NUM_CATH;
//#         rms.seek(fList, start);
//#         pozbuf = -LEN_BUF;
//#         int end = rms.length(fList);
//# //debug("start: "+start+" end: "+end);
//#         for (int ind = 0; ind * LEN_THICK < end - start; ind++) {
//# //debug("prochazim ind slovicka: "+ind);
//#           if (ind * LEN_THICK >= pozbuf + LEN_BUF) {
//#             rms.seek(fList, start + (ind * LEN_THICK) / LEN_BUF * LEN_BUF);
//#             rms.read(fList, buf, 0, LEN_BUF);
//#           }
//#           int poz = (/*start+*/ind * LEN_THICK) % LEN_BUF;
//#           int from = buf[poz + 4] == 0 ? buf[poz + 2] : buf[poz + 3];
//#           int to = buf[poz + 4] == 0 ? buf[poz + 3] : buf[poz + 2];
//#           int cat = buf[poz + 1];
//#           int i;
//#           for (i = 0; i < catTest.length; i++) {
//#             if (catTest[i] == cat && fromTest[i] == from && toTest[i] == to) {
//#               break;
//#             }
//#           }
//#           if (i < catTest.length) {
//# //debug("dobra kategorie");
//#             wordTryList[wordNum] = (char) (buf[poz + 10] | (buf[poz + 11] << 8));
//#             wordSuccList[wordNum] = (char) (buf[poz + 12] | (buf[poz + 13] << 8));
//#             wordOppList[wordNum] = (char) buf[poz + 4];
//#             wordIndList[wordNum] = (char) ind;
//#             wordNum++;
//#             if (wordNum == wordIndList.length) {
//#               System.out.println("Nemelo by se stat: pocty slovicek u kategorii nesedi");
//#               wordTryList = doubleList(wordTryList);
//#               wordSuccList = doubleList(wordSuccList);
//#               wordIndList = doubleList(wordIndList);
//#               wordOppList = doubleList(wordOppList);
//#             }
//#           }
//#         }
//#       } catch (IOException e) {
//#         debug("IO v makeIndex.");
//#         return -2;
//#       }
//#     }
//#
//#     int smI = -1;
//#     int smT = 1;
//#     int smS = 1;
//#     int smOpp = 0;
//# //debug("wordNum: "+wordNum);
//#     for (int i = 0; i < wordNum; i++) {
//#       int actT = wordTryList[i];
//#       int actS = wordSuccList[i];
//#       if (actS * smT * 2 + wordOppList[i] < smS * actT * 2 + smOpp) {
//#         smT = actT;
//#         smS = actS;
//#         smI = i;
//#         smOpp = wordOppList[i];
//#       }
//#     }
//#
//#     if (smI == -1) {
//#       debug("nemelo by se stat: najitej index je -1");
//#     }
//#
//#     return smI;
//#   }
//#
//#   private char[] doubleList(char[] list) {
//#     return doubleList(list, list.length);
//#   }
//#
//#   private char[] doubleList(char[] list, int len) {
//#     char[] newList = new char[Math.max(list == null ? 0 : list.length * 2, len)];
//#     if (list != null) {
//#       System.arraycopy(list, 0, newList, 0, list.length);
//#     }
//#     return newList;
//#   }
//#
//#   Translation showAnswer() {
//#     return showWord(true);
//#   }
//#
//#   Translation answer(boolean success) {
//#     try {
//#       if (minI < 0) {
//#         debug("nemeloby se stat: minI<0 v answer");
//#         return null;
//#       }
//#       int smT = (++wordTryList[minI]);
//#       int smS = (++wordSuccList[minI]);
//#       if (!success) {
//#         smT = (++wordTryList[minI]);
//#       }
//#       int minInd = wordIndList[minI];
//#       byte[] written = new byte[]{(byte) (smT & 0xff), (byte) ((smT >> 8) & 0xff),
//#         (byte) (smS & 0xff), (byte) ((smS >> 8) & 0xff)};
//#       int start = LIST_HEADER_LEN + LEN_LANG * NUM_LANG + LEN_CATH * NUM_CATH;
//#       rms.seek(fList, start + (minInd * LEN_THICK) + 10);
//#       debug("write: minInd: " + minInd);
//#       rms.write(fList, written, 0, 4);
//#       minI = -1;
//#       text = null;
//#       return nextQuestion();
//#     } catch (IOException e) {
//#       return get(ERROR_WRITE_WORD, null);
//#     }
//#   }
//#   /*  int makeIndex(){
//#   if (buf==null) buf = new byte[LEN_BUF];
//#   //    if (index==null) index= newIndex();
//#   try{
//#   int start=LIST_HEADER_LEN+LEN_LANG*NUM_LANG+LEN_CATH*NUM_CATH;
//#   rms.seek(fList,start);
//#   pozbuf=-LEN_BUF;
//#   int end=rms.length(fList);
//#   for (int ind=0;ind*LEN_THICK<end-start;ind++){
//#   if (ind*LEN_THICK>=pozbuf+LEN_BUF) {
//#   rms.seek(fList,(start+ind*LEN_THICK)/LEN_BUF*LEN_BUF);
//#   rms.read(fList,buf,0,LEN_BUF);
//#   }
//#   int poz=(start+ind*LEN_THICK)%LEN_BUF;
//#
//#   }
//#   }catch(IOException e){debug("IO v makeIndex.");}
//#   }*/
//#
//#   public void keyPressed(int k, boolean repeat) {
//#     if (k == Canvas.KEY_NUM1) {
//#       if (catSelect != null) {
//#         Translation tr;
//#         if (minI < 0) {
//#           tr = nextQuestion();
//#         } else {
//#           tr = showAnswer();
//#         }
//#         if (tr != null) {
//#           View.setWords(tr);
//#         }
//#       } else {
//#         View.setWords(get(CHOOSE_CATH, null));
//#       }
//#     }
//#     if (k == Canvas.KEY_NUM2) {
//#       View.setWords(answer(true));
//#     }
//#     if (k == Canvas.KEY_NUM3) {
//#       View.setWords(answer(false));
//#     }
//#   }
//#
//#   public void run() {
//#     debug("v run");
//#     if (Thread.currentThread() == thread) {
//#       debug("pred initem");
//#       init();
//#       View.unsetProgress();
//#     } else if (inited) {
//#       //jinak nas uz vola View a neco nam chce:
//#       if (View.TaskToDo != null) {
//#         this.process(View.TaskToDo);
//#       }
//# //      if (View.historyAdd!=null) this.historyAdd(View.historyAdd);
//# //      if (View.newStr!=null) this.newStr(View.newStr,View.poz,View.prefix);
//#       if (View.keyCode != null) {
//#         this.keyPressed(View.keyCode.intValue(), View.repeat);
//#       }
//#     } else {
//#       debug("Assert: run: CView nas nemel co volat");
//#     }
//#   }
//#
//#   public void debug(String str) {
//#ifndef Release
//#     System.out.println(str);
//#endif    
//#   }
//#
//#   public Translation readLearnGen(File rms, int smallLang, int bigLang, String head) {
//#     Vector trs = new Vector();
//#     Vector exts = new Vector();
//#     try {
//# //nejlepsi by bylo prvne zjistit, jestli je jazyk v databazi
//# //pokud ale neni, projevi se to tim, ze ani zadne kategorie nebudou
//#       if (bufCath == null) {
//#         readBuf(rms);
//#       }
//#       Translation tr = new Translation(Translation.SELECT, head, trs, exts, 0);
//#       for (int a = 0; a < NUM_CATH && bufCath[a * LEN_CATH] != 0 && (bufCath[a * LEN_CATH] & FLAG_DEL) == 0; a++) {
//#         if (bufCath[a * LEN_CATH + 1] == smallLang && bufCath[a * LEN_CATH + 2] == bigLang &&
//#                 (bufCath[a * LEN_CATH] & FLAG_DEL) == 0) {
//#           exts.addElement(new Task(Translation.SELECT, a, 2, bufCath[a * LEN_CATH + 8] & 1));
//#           trs.addElement("-> " + readHeap(bufCath, a * LEN_CATH + 3));
//#           exts.addElement(new Task(Translation.SELECT, a + 256, 2, (bufCath[a * LEN_CATH + 8] & 2) >> 1));
//#           trs.addElement("<- " + readHeap(bufCath, a * LEN_CATH + 3));
//#         }
//#       }
//#       if (trs.size() == 1) {
//#         trs.addElement("Datab�ze je pr�zdn�.");
//#         exts.addElement(null);
//#       }
//#       return tr;
//#     } catch (IOException e) {
//#       System.out.println("IOchyba v ReadLearn " + e.getMessage());
//#       e.printStackTrace();
//#       return null;
//#     }
//#   }
//#   public static final int LOADING = 0;
//# //  public static final int NULL=1;presunul jsem do CView
//#   public static final int ERROR_SAVE = 2;
//#   public static final int CORRUPTED = 3;
//#   public static final int FOUNDED = 4;
//#   private static final int ERROR_LOAD = 5;
//#   private static final int ERROR_LOAD_CATH = 17;
//#   private static final int ERROR_READ_WORD = 18;
//#   private static final int CHOOSE_LANGUAGE = 12;
//#   private static final int EMPTY_NAME = 13;
//#   private static final int CONFLICT_NAME = 14;
//#   private static final int ERROR_WRITE_WORD = 15;
//#   private static final int CHOOSE_CATH = 16;
//#   private static final int NO_WORD = 19;
//#
//#   public Translation get(int id, Object param) {
//#     switch (id) {
//#       case (LOADING):
//#         return Translation.fromArray(Translation.INFO, "Nahr�v�m", new String[]{
//#                   "Pros�m strpen�..."});
//#       case (ERROR_SAVE):
//#         return Translation.fromArray(Translation.INFO, "Chyba ukl�d�n�!", new String[]{
//#                   "Nepoda�ilo se p�istoupit k �lo�n�mu prostoru. Nebudete moci vyu��t u�en� slov��ek a nov� nastaven� patrn� nebudou ulo�ena.\n",
//#                   "Zkontrolujte voln� m�sto na �lo�n�m prostoru\n"});
//#       case (CORRUPTED):
//#         return Translation.fromArray(Translation.INFO, "Stav neulo�en!", new String[]{
//#                   "Nebyl spr�vn� ulo�en stav po posledn�m spu�t�n� t�to aplikace.\n",
//#                   "Mohou b�t ztracena n�kter� slov��ka k u�en� nebo nov� nastaven�.\n",
//#                   "Zkontrolujte voln� m�sto na �lo�n�m prostoru\n"});
//#       case (FOUNDED):
//#         return Translation.fromArray(Translation.INFO, "Prvn� spu�t�n�",
//#                 new String[]{"Byl vytvo�en �lo�n� prostor a zalo�ena datab�ze slov��ek k u�en�\n"});
//# //      case (NULL):return Translation.fromArray(Translation.INFO,"Null data",new String[]{
//# //          "��dn� data k zobrazen�"});
//#       case (ERROR_LOAD):
//#         return Translation.fromArray(Translation.INFO, "Chyba �ten�",
//#                 new String[]{"Nepoda�ilo se na��st datab�zi k u�en�\n"});
//#       case (ERROR_LOAD_CATH):
//#         return Translation.fromArray(Translation.INFO, "Chyba �ten�",
//#                 new String[]{"Nepoda�ilo se na��st datab�zi kategori� jazyka " + ((String) param) + "\n"});
//#       case (ERROR_READ_WORD):
//#         return Translation.fromArray(Translation.INFO, "Chyba �ten�",
//#                 new String[]{"Chyba �ten� z datab�ze slov��ek.\n"});
//#       case (CHOOSE_LANGUAGE):
//#         return Translation.fromArray(Translation.INFO, "Vyber slovn�k",
//#                 new String[]{"P�ed pou�it�m u�en� slov��ek vyberte slovn�k"});
//#       case (EMPTY_NAME):
//#         return Translation.fromArray(Translation.MENU, "Nedovoluji",
//#                 new String[]{"Zadat kategorii pr�zdn� jm�no"});
//#       case (CONFLICT_NAME):
//#         return Translation.fromArray(Translation.MENU, "Nedovoluji",
//#                 new String[]{"Zadat kategorii ji� pou�it� jm�no"});
//#       case (ERROR_WRITE_WORD):
//#         return Translation.fromArray(Translation.INFO, "Chyba z�pisu",
//#                 new String[]{"Chyba p�i z�pisu slov��ka do datab�ze u�en�"});
//#       case (CHOOSE_CATH):
//#         return Translation.fromArray(Translation.INFO, "Vyber kategorii",
//#                 new String[]{"Vyber jeho kategore, ze kter�ch se budou slov��ka k u�en� vyb�rat"});
//#       case (NO_WORD):
//#         return Translation.fromArray(Translation.INFO, "Nen� slov��ko",
//#                 new String[]{"V dan�ch kategori�ch nen� ��dn� slov��ko k u�en� ulo�eno"});
//#     }
//#     System.out.println("bude null translation");
//#     return null;
//#   }
//# }
//#